using System;
using System.Data;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace DemonstrationWebsite.ClientSideGridDemo
{
    /// <summary>
    /// In a real application you'd probably be getting this data from your database, but for
    /// this demo we'll skip that part and use a hard-coded data set
    /// </summary>
    public static class SalesDataAccess
    {
        public static List<SaleRecord> GetSalesRecords()
        {
            List<SaleRecord> results = new List<SaleRecord>();

            results.Add(new SaleRecord(1, DateTime.Today.AddDays(-12), "Planet Bollywood", 350));
            results.Add(new SaleRecord(2, DateTime.Today.AddDays(-10), "Tate Pictures Co", 1995.50));
            results.Add(new SaleRecord(3, DateTime.Today.AddDays(-10), "Monsieur Tussaude's", 890));
            results.Add(new SaleRecord(4, DateTime.Today.AddDays(-9), "Buckingham Mansion", 13.25));
            results.Add(new SaleRecord(5, DateTime.Today.AddDays(-8), "Underground Tubes Corp.", 2500));
            results.Add(new SaleRecord(6, DateTime.Today.AddDays(-8), "Canary Dwarf Inc.", 2155.45));
            results.Add(new SaleRecord(7, DateTime.Today.AddDays(-7), "Unnatural History Museum", 817));
            results.Add(new SaleRecord(8, DateTime.Today.AddDays(-6), "Hammey's Toys", 890));
            results.Add(new SaleRecord(9, DateTime.Today.AddDays(-4), "The Glitz Hotel", 850.10));
            results.Add(new SaleRecord(10, DateTime.Today.AddDays(-4), "Eastmister Abbey", 355));
            results.Add(new SaleRecord(11, DateTime.Today.AddDays(-2), "The London Ear", 750));
            results.Add(new SaleRecord(12, DateTime.Today.AddDays(-1), "Bee-Bee Sea", 1000));

            return results;
        }


    }

    public class SaleRecord // Dummy class represents a row you might retrieve from your database
    {
        public int SaleID;
        public DateTime Date;
        public string CustomerName;
        public double DollarValue;

        public SaleRecord(int saleID, DateTime date, string customerName, double dollarValue)
        {
            SaleID = saleID;
            Date = date;
            CustomerName = customerName;
            DollarValue = dollarValue;
        }

        public SaleRecord() { } // Parameterless constructor needed to deserialize data
    }
}
